package progress.exa27_5;

import java.util.HashSet;

public class HashSetStudy {
    public static void main(String[] args) {
        HashSet<Integer> set = new HashSet<>();
        long start = System.currentTimeMillis();
        set.add(null);
        for(int i=0;i<10000000;i++){
            set.add(i);
        }
        System.out.println("存储耗时： "+(System.currentTimeMillis()-start)+" ms");
        long start2 = System.currentTimeMillis();
        for(int i=0;i<10000000;i++){
           boolean c = set.contains(i);
        }
        System.out.println("查询耗时： "+(System.currentTimeMillis()-start2)+" ms");
    }
}
